package com.c.ctgproject.wiget

import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.c.ctgproject.R
import com.c.ctgproject.adapter.service.ImageRecyclerViewAdapter

class ServiceDetailPictureLayout : LinearLayoutCompat {
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        val view = LayoutInflater.from(context).inflate(R.layout.view_service_image_horizontal_layout, this)
        mTextView = view.findViewById(R.id.mTextView)
    }

    constructor(context: AppCompatActivity, left: String, image: List<String>) : super(context) {
        val view = LayoutInflater.from(context).inflate(R.layout.view_service_image_horizontal_layout, this)
        mTextView = view.findViewById(R.id.mTextView)
        val rv:RecyclerView = view.findViewById(R.id.mRecyclerView)
        rv.adapter=ImageRecyclerViewAdapter(context,image)
        rv.layoutManager=LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
        setStartTV(left)
    }

    private var mTextView: TextView? = null


    fun setStartTV(str: String) {
        mTextView?.text = str
    }

}